import request from '/@/utils/request';

/**
 * 系统菜单api
 */
export function useMenuApi() {
	return {
		getAdminMenu: (params?: object) => {
			return request({
				url: 'sysMenu/menu',
				method: 'post',
				data: params,
			});
		},
		getTestMenu: (params?: object) => {
			return request({
				url: 'sysMenu/menu',
				method: 'post',
				params,
			});
		},
		getMenu: () => {
			return request({
				url: 'sysMenu/menu',
				method: 'get',
			});
		},
		// 新增
		addRecord: (params: object) => {
			return request({
				url: 'sysMenu/add',
				method: 'post',
				data: params,
			});
		},
		// 修改
		updateRecord: (params: object) => {
			return request({
				url: 'sysMenu/update',
				method: 'post',
				data: params,
			});
		},
		// 删除
		delRecord: (menu: object) => {
			return request({
				url: 'sysMenu/delete',
				method: 'post',
				data: menu,
			});
		},
	};
}
